#include "Thread.hpp"
#include <unistd.h>
using namespace ThreadModle;

int main()
{
    Thread t([](){
        while(true){
            char name[128];
            pthread_getname_np(pthread_self(), name, sizeof(name));
            std::cout << "我是一个新线程：" << name << std::endl;
            sleep(1);
        }
    });
    
    t.Start();

    sleep(3);

    t.Detach();

    sleep(5);

    t.Stop();

    sleep(5);

    t.Join();

    return 0;
}